part of _;

extension on SettingsPage {
  Widget view_selectLanguage() {
    return YListTile(
      "语言设置",
      null,
      () => controller_showSelectLanguage(),
      bgColor: Colors.white,
      right: Row(
        children: [
          Image.asset(getLanguageImage(appLocale), width: 20),
          Icon(Icons.chevron_right, color: Colors.grey),
        ],
      ),
    );
  }

  Widget view_bind() {
    return YListTile(
      "账号绑定",
      null,
      () => yIntent(BindPage()),
      bgColor: Colors.white,
      right: Icon(Icons.chevron_right, color: Colors.grey),
    );
  }

  Widget view_password() {
    return YListTile(
      "修改密码",
      null,
      () => controller_showUpdatePassword(),
      bgColor: Colors.white,
      right: Icon(Icons.chevron_right, color: Colors.grey),
    );
  }

  Widget view_cache() {
    return YListTile(
      "清理缓存",
      null,
      () async {
        yShowProgress();
        await FileUtils.clearCache();
        yDismissProgress();
        yToast("清理完成");
        controller_loadCache();
      },
      bgColor: Colors.white,
      right: Row(
        children: [
          Text(cache, style: TextStyle(color: Colors.grey)),
          Icon(Icons.chevron_right, color: Colors.grey),
        ],
      ),
    );
  }

  Widget view_logout() {
    return YButton(
      width: yScreenSize().width,
      height: 45,
      color: Colors.white,
      child: Text("退出登录"),
      onTap: () {
        yShowBuilder("确认退出登录吗？", () {
          AppUtils.reLaunchApp(goLogin: true, deleteUser: true);
        }, null, true);
      },
    );
  }
}
